
import 'package:flutter/cupertino.dart';
import 'package:wan_android_flutter/repository/Api.dart';

import '../../repository/datas/common_website_data.dart';
import '../../repository/datas/search_hot_keys_data.dart';

class HotKeyViewModel with ChangeNotifier {
  List<SearchHotKeysData>? searchHotKeys;
  List<CommonWebsiteData>? commonWebsites;


  Future initData()async{
    getWebsiteList().then((webSite){
      getSearchHotKeysList().then((hotKey){
        notifyListeners();
      });
    });
  }

  //常用网站
  Future getWebsiteList() async{
    commonWebsites = await Api.instance().getWebsiteList();
  }

  //热点keys
  Future getSearchHotKeysList() async{
    searchHotKeys = await Api.instance().getSearchHotKeysList();
  }
}